package com.hqyj.springBoot.modules.account.dao;

import com.hqyj.springBoot.modules.account.entity.RoleResource;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface RoleResourceDao {

    @Insert("insert into account_role_resource(role_id,resource_id) values (#{roleId},#{resourceId})")
    @Options(useGeneratedKeys = true,keyColumn = "id",keyProperty = "id")
    void insertRoleResource(RoleResource roleResource);

    @Select("select * from account_role_resource where id = #{roleResourceId}")
    RoleResource selectRoleResourceById(int roleResourceId);

}
